/**
 * 
 */
package com;

/**
 * @author LionBule
 */
public class Test extends ClassLoader {

    public static void main(String[] args) throws InterruptedException {
        int baseDbNum = 2000000;
        int baseTabNum = 500;
        int[] num = new int[] { 2, 123000, 2203000, 3002340, 4000000, 4000001, 5000000, 33592341, };

        for (int t : num) {
            System.out.println("t=" + t + " \t dbIndex=" + (t / baseDbNum + 1) + " \t tableIndex="
                    + ((t % baseTabNum) + 1));
        }
 
    }

    static int hash(int h) {
        // This function ensures that hashCodes that differ only by
        // constant multiples at each bit position have a bounded
        // number of collisions (approximately 8 at default load factor).
        h ^= (h >>> 20) ^ (h >>> 12);
        return h ^ (h >>> 7) ^ (h >>> 4);
    }

    public static String printThreadInfo(Thread thread) {
        StackTraceElement[] rs = thread.getStackTrace();
        StringBuilder sb = new StringBuilder();
        for (StackTraceElement t : rs) {
            sb.append(t).append("\n");
        }
        return sb.toString();
    }

}
